<div class="content-section introduction">
    <div class="feature-intro">
        <h1>MegaMenu</h1>
        <p>MegaMenu is navigation component that displays submenus together.</p>
    </div>
    <app-demoActions github="megamenu" stackblitz="megamenu-demo"></app-demoActions>
</div>

<div class="content-section implementation">
    <div class="card">
        <h5>Horizontal</h5>
        <p-megaMenu [model]="items"></p-megaMenu>
        
        <h5>Vertical</h5>
        <p-megaMenu [model]="items" orientation="vertical"></p-megaMenu>
    </div>
</div>

<div class="content-section documentation">
    <p-tabView>
        <p-tabPanel header="Documentation">
            <h5>Import</h5>
<app-code lang="typescript" ngNonBindable ngPreserveWhitespaces>
import &#123;MegaMenuModule&#125; from 'primeng/megamenu';
</app-code>

            <h5>MenuModel API</h5>
            <p>MegaMenu uses the common menumodel api to define its items, visit <a [routerLink]="['/menumodel']">MenuModel API</a> for details.</p>

            <h5>Getting Started</h5>
            <p>MegaMenu requires nested menuitems as its model where the items of a root menuitem is a two dimensional array to define columns in an overlay submenu.</p>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-megaMenu [model]="items"&gt;&lt;/p-megaMenu&gt;
</app-code>

<app-code lang="typescript" ngNonBindable ngPreserveWhitespaces>
import &#123;MegaMenuItem,MenuItem&#125; from 'primeng/api';

export class MegaMenuDemo &#123;

    items: MegaMenuItem[];

    ngOnInit() &#123;
        this.items = [
            &#123;
                label: 'Videos', icon: 'pi pi-fw pi-video',
                items: [
                    [
                        &#123;
                            label: 'Video 1',
                            items: [&#123;label: 'Video 1.1'&#125;, &#123;label: 'Video 1.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'Video 2',
                            items: [&#123;label: 'Video 2.1'&#125;, &#123;label: 'Video 2.2'&#125;]
                        &#125;
                    ],
                    [
                        &#123;
                            label: 'Video 3',
                            items: [&#123;label: 'Video 3.1'&#125;, &#123;label: 'Video 3.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'Video 4',
                            items: [&#123;label: 'Video 4.1'&#125;, &#123;label: 'Video 4.2'&#125;]
                        &#125;
                    ]
                ]
            &#125;,
            &#123;
                label: 'Users', icon: 'pi pi-fw pi-users',
                items: [
                    [
                        &#123;
                            label: 'User 1',
                            items: [&#123;label: 'User 1.1'&#125;, &#123;label: 'User 1.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'User 2',
                            items: [&#123;label: 'User 2.1'&#125;, &#123;label: 'User 2.2'&#125;]
                        &#125;,
                    ],
                    [
                        &#123;
                            label: 'User 3',
                            items: [&#123;label: 'User 3.1'&#125;, &#123;label: 'User 3.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'User 4',
                            items: [&#123;label: 'User 4.1'&#125;, &#123;label: 'User 4.2'&#125;]
                        &#125;
                    ],
                    [
                        &#123;
                            label: 'User 5',
                            items: [&#123;label: 'User 5.1'&#125;, &#123;label: 'User 5.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'User 6',
                            items: [&#123;label: 'User 6.1'&#125;, &#123;label: 'User 6.2'&#125;]
                        &#125;
                    ]
                ]
            &#125;,
            &#123;
                label: 'Events', icon: 'pi pi-fw pi-calendar',
                items: [
                    [
                        &#123;
                            label: 'Event 1',
                            items: [&#123;label: 'Event 1.1'&#125;, &#123;label: 'Event 1.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'Event 2',
                            items: [&#123;label: 'Event 2.1'&#125;, &#123;label: 'Event 2.2'&#125;]
                        &#125;
                    ],
                    [
                        &#123;
                            label: 'Event 3',
                            items: [&#123;label: 'Event 3.1'&#125;, &#123;label: 'Event 3.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'Event 4',
                            items: [&#123;label: 'Event 4.1'&#125;, &#123;label: 'Event 4.2'&#125;]
                        &#125;
                    ]
                ]
            &#125;,
            &#123;
                label: 'Settings', icon: 'pi pi-fw pi-cog',
                items: [
                    [
                        &#123;
                            label: 'Setting 1',
                            items: [&#123;label: 'Setting 1.1'&#125;, &#123;label: 'Setting 1.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'Setting 2',
                            items: [&#123;label: 'Setting 2.1'&#125;, &#123;label: 'Setting 2.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'Setting 3',
                            items: [&#123;label: 'Setting 3.1'&#125;, &#123;label: 'Setting 3.2'&#125;]
                        &#125;
                    ],
                    [
                        &#123;
                            label: 'Technology 4',
                            items: [&#123;label: 'Setting 4.1'&#125;, &#123;label: 'Setting 4.2'&#125;]
                        &#125;
                    ]
                ]
            &#125;
        ]
    &#125;
&#125;
</app-code>

            <h5>Custom Content</h5>
            <p>Custom content can be placed between p-megaMenu tags. Megamenu should be horizontal for custom content.</p>

<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-megaMenu [model]="items"&gt;
    &lt;input type="text" pInputText placeholder="Search"&gt;
    &lt;button pButton label="Logout" icon="pi pi-sign-out"&gt;&lt;/button&gt;
&lt;/p-megaMenu&gt;
</app-code>


            <h5>Properties</h5>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Type</th>
                            <th>Default</th>
                            <th>Description</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>model</td>
                            <td>array</td>
                            <td>null</td>
                            <td>An array of menuitems.</td>
                        </tr>
                        <tr>
                            <td>orientation</td>
                            <td>string</td>
                            <td>horizontal</td>
                            <td>Defines the orientation, valid values are horizontal and vertical.</td>
                        </tr>
                        <tr>
                            <td>style</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Inline style of the component.</td>
                        </tr>
                        <tr>
                            <td>styleClass</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Style class of the component.</td>
                        </tr>
                        <tr>
                            <td>baseZIndex</td>
                            <td>number</td>
                            <td>0</td>
                            <td>Base zIndex value to use in layering.</td>
                        </tr>
                        <tr>
                            <td>autoZIndex</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>Whether to automatically manage layering.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Templates</h5>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Parameters</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>start</td>
                            <td>-</td>
                        </tr>
                        <tr>
                            <td>end</td>
                            <td>-</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Styling</h5>
            <p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming page</a>.</p>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                    <tr>
                        <th>Name</th>
                        <th>Element</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>p-megamenu</td>
                        <td>Container element.</td>
                    </tr>
                    <tr>
                        <td>p-menu-list</td>
                        <td>List element.</td>
                    </tr>
                    <tr>
                        <td>p-menuitem</td>
                        <td>Menuitem element.</td>
                    </tr>
                    <tr>
                        <td>p-menuitem-text</td>
                        <td>Label of a menuitem.</td>
                    </tr>
                    <tr>
                        <td>p-menuitem-icon</td>
                        <td>Icon of a menuitem.</td>
                    </tr>
                    <tr>
                        <td>p-submenu-icon</td>
                        <td>Arrow icon of a submenu.</td>
                    </tr>
                    </tbody>
                </table>
            </div>

<h5>Dependencies</h5>
<p>None.</p>
</p-tabPanel>

<p-tabPanel header="Source">
    <a href="https://github.com/primefaces/primeng/tree/master/src/app/showcase/components/megamenu" class="btn-viewsource" target="_blank">
        <span>View on GitHub</span>
    </a>
    <a href="https://stackblitz.com/edit/primeng-megamenu-demo" class="btn-viewsource" style="margin-left: .5em;" target="_blank">
        <span>Edit in StackBlitz</span>
    </a>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;h5&gt;Horizontal&lt;/h5&gt;
&lt;p-megaMenu [model]="items"&gt;&lt;/p-megaMenu&gt;

&lt;h5&gt;Vertical&lt;/h5&gt;
&lt;p-megaMenu [model]="items" orientation="vertical"&gt;&lt;/p-megaMenu&gt;
</app-code>

<app-code lang="typescript" ngNonBindable ngPreserveWhitespaces>
import &#123;MegaMenuItem,MenuItem&#125; from 'primeng/api';

export class MegaMenuDemo &#123;

    items: MegaMenuItem[];

    ngOnInit() &#123;
        this.items = [
            &#123;
                label: 'Videos', icon: 'pi pi-fw pi-video',
                items: [
                    [
                        &#123;
                            label: 'Video 1',
                            items: [&#123;label: 'Video 1.1'&#125;, &#123;label: 'Video 1.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'Video 2',
                            items: [&#123;label: 'Video 2.1'&#125;, &#123;label: 'Video 2.2'&#125;]
                        &#125;
                    ],
                    [
                        &#123;
                            label: 'Video 3',
                            items: [&#123;label: 'Video 3.1'&#125;, &#123;label: 'Video 3.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'Video 4',
                            items: [&#123;label: 'Video 4.1'&#125;, &#123;label: 'Video 4.2'&#125;]
                        &#125;
                    ]
                ]
            &#125;,
            &#123;
                label: 'Users', icon: 'pi pi-fw pi-users',
                items: [
                    [
                        &#123;
                            label: 'User 1',
                            items: [&#123;label: 'User 1.1'&#125;, &#123;label: 'User 1.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'User 2',
                            items: [&#123;label: 'User 2.1'&#125;, &#123;label: 'User 2.2'&#125;]
                        &#125;,
                    ],
                    [
                        &#123;
                            label: 'User 3',
                            items: [&#123;label: 'User 3.1'&#125;, &#123;label: 'User 3.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'User 4',
                            items: [&#123;label: 'User 4.1'&#125;, &#123;label: 'User 4.2'&#125;]
                        &#125;
                    ],
                    [
                        &#123;
                            label: 'User 5',
                            items: [&#123;label: 'User 5.1'&#125;, &#123;label: 'User 5.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'User 6',
                            items: [&#123;label: 'User 6.1'&#125;, &#123;label: 'User 6.2'&#125;]
                        &#125;
                    ]
                ]
            &#125;,
            &#123;
                label: 'Events', icon: 'pi pi-fw pi-calendar',
                items: [
                    [
                        &#123;
                            label: 'Event 1',
                            items: [&#123;label: 'Event 1.1'&#125;, &#123;label: 'Event 1.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'Event 2',
                            items: [&#123;label: 'Event 2.1'&#125;, &#123;label: 'Event 2.2'&#125;]
                        &#125;
                    ],
                    [
                        &#123;
                            label: 'Event 3',
                            items: [&#123;label: 'Event 3.1'&#125;, &#123;label: 'Event 3.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'Event 4',
                            items: [&#123;label: 'Event 4.1'&#125;, &#123;label: 'Event 4.2'&#125;]
                        &#125;
                    ]
                ]
            &#125;,
            &#123;
                label: 'Settings', icon: 'pi pi-fw pi-cog',
                items: [
                    [
                        &#123;
                            label: 'Setting 1',
                            items: [&#123;label: 'Setting 1.1'&#125;, &#123;label: 'Setting 1.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'Setting 2',
                            items: [&#123;label: 'Setting 2.1'&#125;, &#123;label: 'Setting 2.2'&#125;]
                        &#125;,
                        &#123;
                            label: 'Setting 3',
                            items: [&#123;label: 'Setting 3.1'&#125;, &#123;label: 'Setting 3.2'&#125;]
                        &#125;
                    ],
                    [
                        &#123;
                            label: 'Technology 4',
                            items: [&#123;label: 'Setting 4.1'&#125;, &#123;label: 'Setting 4.2'&#125;]
                        &#125;
                    ]
                ]
            &#125;
        ]
    &#125;
&#125;
</app-code>
</p-tabPanel>
<p-tabPanel header="StackBlitz">
    <ng-template pTemplate="content">
        <iframe src="https://stackblitz.com/edit/primeng-megamenu-demo?embed=1" style="width: 100%; height: 768px; border: none;"></iframe>
    </ng-template>
</p-tabPanel>
</p-tabView>
</div>